package
{
	import code.main.AppInit;
	
	import flash.display.MovieClip;
	import flash.events.Event;
	
	public class Main extends MovieClip
	{
		public function Main()
		{
			if(stage)
			{
				init();
			}else
			{
				addEventListener(Event.ADDED_TO_STAGE,onAddToStageHandler);
			}
		}
		
		protected function onAddToStageHandler(event:Event):void
		{
			removeEventListener(Event.ADDED_TO_STAGE,onAddToStageHandler);
			init();
		}
		
		private function init():void{
			AppInit.getInstance().start();
		}
	}
}